from selenium.webdriver.common.by import By

from class23test0515.page_object.basepage import BasePage
from class23test0515.until.log_until import logger


class HomePage(BasePage):

    def go_to_add_member(self):
        from class23test0515.page_object.addmemberpage import AddMemberPage
        logger.info("点击添加成员按钮")
        self.do_find(By.XPATH, '//span[text()="添加成员"]').click()
        return AddMemberPage(self.driver)

    def go_to_contact(self):
        from class23test0515.page_object.contactpage import ContactPage
        logger.info("点击通讯录按钮")
        self.do_find(By.ID, 'menu_contacts').click()
        return ContactPage(self.driver)
